import request from '@/utils/request'
export function ruleAdd(data,type) {
    
    return request({
        url: `/pass/api/${type}/rule/add`,
        method: 'post',
        data,
        headers: {
            'content-type':'application/json'
        }
    })
}

export function ruleDelete(params,type) {
    let query='?ruleNumber='+params
    return request({
        url: `/pass/api/${type}/rule/delete`+query,
        method: 'delete',
       
    })
}

export function ruleDetail(params,type) {
    let query='?ruleNumber='+params
    return request({
        url: `/pass/api/${type}/rule/detail`+query,
        method: 'get',
       
    })
}

export function ruleList(params,type) {
    
    return request({
        url: `/pass/api/${type}/rule/list`,
        method: 'get',
        params
    })

}

export function ruleUpdate(data,type) {
    
    return request({
        url: `/pass/api/${type}/rule/update`,
        method: 'put',
        data,
        headers: {
            'content-type':'application/json'
        }
    })
}

